# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=lomiri-url-dispatcher
pkgver=0.1.3
pkgrel=2
pkgdesc="Service to allow sending of URLs and get handlers started"
arch="all"
url="https://gitlab.com/ubports/development/core/lomiri-url-dispatcher"
license="LGPL-3.0-only"
depends_dev="
	click-dev
	dbus-test-runner-dev
	gtest-dev
	json-glib-dev
	libapparmor-dev
	lomiri-app-launch-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	dbus-test-runner
	glib-dev
	gmock
	intltool
	samurai
	"
checkdepends="py3-dbusmock"
source="https://gitlab.com/ubports/development/core/lomiri-url-dispatcher/-/archive/$pkgver/lomiri-url-dispatcher-$pkgver.tar.gz
	0001-remove-systemd.patch
	"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # several tests hang

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		-Denable_mirclient=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3aeae627e5e01fff6a1201d5fd2f5d52b78b1c628feadf19f0f23e6cad34004212930e317c584f3fc9d67a9dac6dea72bac770747f2a6a116359d5e55a20fd77  lomiri-url-dispatcher-0.1.3.tar.gz
586d24fd32f368b7f0404d4f5664bde8ed85e88e79f4532aa686ba0e4fc5c6c9c3c33832fded9f09bc5eba983b853a6be2204d9796a571e2dfecfa1afaf9f74f  0001-remove-systemd.patch
"
